Developing Microsoft® Media Foundation Applications by Anton Polinger
Author:Anton Polinger [Anton Polinger]
Language: eng
Format: epub
Tags: COMPUTERS / Interactive & Multimedia
ISBN: 9780735656574
Publisher: Microsoft Press
Published: 2011-10-17T16:00:00+00:00
Chapter 7. Media Foundation Sinks
The Sample AVI File Sink
The AVI Media Sink
The AVI Media Stream
Media sinks are objects in the Microsoft Media Foundation (MF) pipeline that receive one or more input streams but have no output streams. The purpose of most sinks in the MF pipeline is to consume all of the data and provide it to the user in some form. In an MF topology, each requested (selected) stream comes out of a media source, is processed by zero or more MFTs, and ends in the media sink.
There are three major types of media sinks: renderer, archive, and streaming sinks. A renderer sink “renders” the input data and presents it to the user. The way that a renderer sink presents the information to the user depends on the type of data. For example, the Enhanced Video Renderer (EVR) renders input video frames to the screen, whereas the Streaming Audio Renderer (SAR) sends the audio samples to an output audio device. Archive sinks save data into a media file, usually after multiplexing several data streams into one. Unlike rendering sinks, archive sinks pull data from the source as fast as it can be delivered. Finally, streaming sinks are designed for streaming network scenarios and transmit the data over the network. In some ways, streaming sinks are similar to the archive sinks—they also pull data from the source as quickly as they can. However, unlike archive sinks, streaming sinks support rate changes and seeking.
Because MF uses the pull data flow model, sinks are responsible for requesting data from the source components. To request samples, a sink fires sample request events, which are received by the sink’s client. The client then requests samples from the component upstream from the sink, which in turn pulls data from its upstream component, and so on.
Unlike sources, sinks do not have dedicated creator objects. There is no equivalent to the IMFByteStreamHandler object that is supposed to create a sink. Unfortunately, MF does not have a discovery system capable of automatically finding which sinks are available on the machine. There are no designated registry locations that contain available sinks and their corresponding container types.
Instead, all MF sinks are treated as pure COM objects. To instantiate a custom sink, your application needs to know its COM Class ID (CLSID) and either explicitly call CoCreateInstance() or pass that CLSID to a manually created activator object. If you want to instantiate one of the standard Microsoft-provided sinks, you can use one of the built-in MF sink creation functions, but these functions use hard-coded lists of internal sink objects. The functions do not dynamically discover supported sinks on the machine by looking in the registry for lists of sink CLSIDs but instantiate specific and well-known sink objects. Here is a list of MF sink creation functions provided in Windows 7:
MFCreate3GPMediaSink() Create a media sink capable of writing files and streams in 3GP format.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(21544)
Hello! Python by Anthony Briggs(20782)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(19230)
Dependency Injection in .NET by Mark Seemann(18848)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(18455)
Kotlin in Action by Dmitry Jemerov(18221)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(18083)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(16947)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(16936)
Grails in Action by Glen Smith Peter Ledbrook(16061)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(13768)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(11781)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(10625)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10590)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(9707)
Hit Refresh by Satya Nadella(9099)
The Kubernetes Operator Framework Book by Michael Dame(8534)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8358)
Robo-Advisor with Python by Aki Ranin(8302)